﻿<Window x:Class="Coding4Fun.BoxingBots.Scoreboard.AdminWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="AdminWindow" 
		Height="544" 
		Width="1252" 
		Loaded="Window_Loaded"
		KeyDown="Window_KeyDown"
		Closing="Window_Closing">
    <Window.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="24"/>
        </Style>
    </Window.Resources>
    <Grid>
        <StackPanel Orientation="Horizontal">
            <Grid Width="600">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                    
                <TextBlock Grid.Row="0" Grid.Column="0">User Console 1: <Run x:Name="Console1Connected">False</Run></TextBlock>
                <TextBlock Grid.Row="0" Grid.Column="1">User Console 2: <Run x:Name="Console2Connected">False</Run></TextBlock>

                <TextBlock Grid.Row="1" Grid.Column="0">Robot 1: <Run x:Name="Robot1Connected">False</Run></TextBlock>
                <TextBlock Grid.Row="1" Grid.Column="1">Robot 2: <Run x:Name="Robot2Connected">False</Run></TextBlock>


                <TextBlock Grid.Row="2" Grid.Column="0">Override 1: <Run x:Name="OverrideDisplay1">Unknown</Run></TextBlock>
                <TextBlock Grid.Row="2" Grid.Column="1">Override 2: <Run x:Name="OverrideDisplay2">Unknown</Run></TextBlock>

                <TextBlock Grid.Row="3" Grid.Column="0">Game State: <Run x:Name="GameStateDisplay">Unknown</Run></TextBlock>
                
                <StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal">
                    <TextBlock>Robot 1 Health: <Run x:Name="Robot1Health">0</Run></TextBlock>
                    <Slider x:Name="Robot1HealthSlider" Minimum="0" Maximum="8" TickFrequency="1" TickPlacement="BottomRight"  Width="100" Margin="15,0,0,0" AutoToolTipPlacement="BottomRight" Interval="1" SmallChange="1" IsSnapToTickEnabled="True" ValueChanged="Robot1HealthSlider_ValueChanged" />
                </StackPanel>
                <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
                    <TextBlock>Robot 2 Health: <Run x:Name="Robot2Health">0</Run></TextBlock>
                    <Slider x:Name="Robot2HealthSlider" Minimum="0" Maximum="8" TickFrequency="1" TickPlacement="BottomRight"  Width="100" Margin="15,0,0,0" AutoToolTipPlacement="BottomRight" Interval="1" SmallChange="1" IsSnapToTickEnabled="True" ValueChanged="Robot2HealthSlider_ValueChanged" />
                </StackPanel>

                <TextBlock Grid.Row="5">Timer: <Run x:Name="Timer">99.9</Run></TextBlock>
                <StackPanel Grid.Row="5" Grid.Column="1">
                    <CheckBox x:Name="OverrideCheck"  IsChecked="{Binding ConnectedOverride, Mode=OneWayToSource}">Override disconnected devices</CheckBox>
                    <CheckBox x:Name="MuteKinectAudio">Mute Kinect Audio</CheckBox>
                </StackPanel>
                <StackPanel Grid.Row="6" Grid.ColumnSpan="2">
					<Button x:Name="StartGame" Click="StartGame_Click" Margin="6">Start Game (F1)</Button>
					<Button x:Name="PauseGame" Click="PauseGame_Click" Margin="6">Pause/Resume Game (F2)</Button>
					<Button x:Name="EndGame" Click="EndGame_Click" Margin="6">End Game (F3)</Button>
                    <Button x:Name="ResetGame" Click="ResetGame_Click" Margin="6">Reset Game (F4)</Button>
                </StackPanel>
                <TextBlock Grid.Row="7" Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold">
                    1) Connect to User Console from here --><LineBreak/>
                    2) Connect to each Robot from here --><LineBreak/>
                    3) Start Game --^<LineBreak/>
                    <LineBreak/>
                    - If robot or user console disconnects, game pauses. Only admin can Resume<LineBreak/>
                    - If referee uses manual override (Xbox controller), game pauses. Only admin can Resume<LineBreak/>
                    - Sliders can be used to change health value of each robot manually<LineBreak/>
                    - Use "Override disconnected devices" for testing without 2 bots/consoles<LineBreak/>
                    - If "Mute Kinect Audio" is disabled, app.config has turned off Kinect audio completely<LineBreak/>
                </TextBlock>
            </Grid>
            <Grid Width="640">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Image x:Name="Video1" Width="320" Height="240" Grid.Row="0" Grid.Column="0"/>
                <Image x:Name="Video2" Width="320" Height="240" Grid.Row="0" Grid.Column="1"/>

                <TextBlock Grid.Row="1" Grid.Column="0">Skeleton: <Run x:Name="Skeleton1">NotTracked</Run></TextBlock>
                <TextBlock Grid.Row="1" Grid.Column="1">Skeleton: <Run x:Name="Skeleton2">NotTracked</Run></TextBlock>

                <Button x:Name="ConnectUserConsole1" Click="ConnectUserConsole1_Click" Grid.Row="2" Grid.Column="0" Margin="6">Connect User Console 1 (Sheldon)</Button>
				<Button x:Name="ConnectUserConsole2" Click="ConnectUserConsole2_Click" Grid.Row="2" Grid.Column="1" Margin="6">Connect User Console 2 (Howard)</Button>

				<Button x:Name="ConnectRobot1" Click="ConnectRobot1_Click" Grid.Row="3" Grid.Column="0" Margin="6">Connect Robot 1 (Sheldon)</Button>
				<Button x:Name="ConnectRobot2" Click="ConnectRobot2_Click" Grid.Row="3" Grid.Column="1" Margin="6">Connect Robot 2 (Howard)</Button>

				<Button x:Name="ConnectAll" Click="ConnectAll_Click" Grid.Row="4" Grid.ColumnSpan="2" Margin="6">Connect All</Button>
            </Grid>
        </StackPanel>
    </Grid>
</Window>
